import { observable, action, autorun, toJS } from 'mobx';
import { WeaTableNew, WeaForm } from 'comsMobx';
import { WeaLocaleProvider } from 'ecCom';
import { message, Button } from 'antd';
import moment from 'moment';
import * as Apis from '../../apis/remind';

const getLabel = WeaLocaleProvider.getLabel;
const { TableStore } = WeaTableNew;

export default class RemindListStore {
    @observable params = {};
    @observable hidetop = 0;
    @observable reminds = [];
    @observable tabkey = 'all';
    @observable loading = true;
    @observable isSuccess = false;
    @observable content = '';
    
    @action
    doNew = (comObj) => {
      this.inIt();
    }
    @action
    inIt = () => {
      const params = { tabKey: this.tabkey, content: this.content };
      this.loading = true;
      this.isSuccess = false;
      Apis.getRemindListPc(params).then((data) => {
        if (data.status == 'success') {
          // console.log(data)
          this.reminds = data.data;
          this.isSuccess = true;
        } else {
          // console.log("失败");
        }
        this.loading = false;
      });
    }
    @action
    changTabKey = (tabKey) => {
      this.tabkey = tabKey;
    }
    @action
    changeContent = (value) => {
      this.content = value;
    }
    @action
    deleteRemindByRole = (params) => {
      Apis.deleteRemindByRole(params).then((data) => {
        this.inIt();
      });
    }
}
